{template '_header'}
<style type='text/css'>
    .ordertable { width:100%;position: relative;margin-bottom:10px}
    .ordertable tr td:first-child { text-align: right }
    .ordertable tr td {padding:10px 5px 0;vertical-align: top}
    .ordertable1 tr td { text-align: right; }
    .order-container{
        display: -webkit-box;
        display: -webkit-flex;
        display: -ms-flexbox;
        display: flex;
    }
    .order-container-left{
        -webkit-box-flex: 1;
        -webkit-flex: 1;
        -ms-flex: 1;
        flex: 1;
    }
    .order-container-static{
        -webkit-box-flex: 1;
        -webkit-flex: 1;
        -ms-flex: 1;
        flex: 1;
        padding: 30px 50px 0;
    }
    .order-container .status{
        height: 50px;
    }
    .font20{
        font-size:20px;
        font-weight:bold;;
    }
    .trbagpack span{
        margin: 0 10px;
        display: inline-block;
        vertical-align: middle;
    }
    .trbagpack span.address{
        width:150px;
        overflow: hidden;
        text-overflow:ellipsis;
        white-space: nowrap;
    }
    tfoot .price{
        float: right;
    }
    tfoot .price-inner{
        display: inline-block;
        vertical-align: middle;
        width:100px;
        text-align: right;
    }
    .packbag-group{
        border:1px solid #efefef;
    }
    .packbag{
        padding: 0 30px;
    }
    .packbag-title{
        line-height: 33px;
    }
    .packbag-group .packbag-list{
        padding: 20px 33px;
        border-bottom: 1px solid #efefef;
        display: flex;
        align-items: center;
    }
    .packbag-list .packbag-media{
        width:100px;
    }
    .packbag-list .packbag-inner{
        border-left:1px solid #efefef;
        -webkit-box-flex: 1;
        -webkit-flex: 1;
        -ms-flex: 1;
        flex: 1;
    }
    .packbag-goods-list{
        display: flex;
        flex-wrap: wrap;
        width:100%;
    }
    .packbag-goods{
        width:25%;
        display: flex;
        display: -webkit-flex;
        margin: 10px 0 5px;
    }
    .packbag-goods-media{
        width:52px;
        height: 52px;
        margin-right: 10px;
    }
    .packbag-goods-media img{
        width:52px;
        height: 52px;
        border: 1px solid #efefef;
    }
    .packbag-goods-inner{
        flex:1;
        -webkit-box-flex: 1;
        -webkit-flex: 1;
        -ms-flex: 1;
        flex: 1;
        overflow: hidden;
    }
    .packbag-goods-inner p{
        color: #999;
    }
    .packbag-goods-inner .title{
        width:100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .form-control-static li{
        line-height: 26px;
    }
    .table .trorder td{
        border-right:1px solid #efefef;
    }
    .table .trorder td:nth-of-type(1){
        border:none;
    }
</style>
<div class="page-header">
    当前位置：<span class="text-primary">维权处理</span>
</div>
<div class="page-content">
    {if !empty($step_array)}
    <div class="step-region" >
        <ul class="ui-step ui-step-4" >
            {loop $step_array $k1 $v1}
            <li {if $v1['done']==1}class="ui-step-done"{/if}>
            <div class="ui-step-number">{$v1['step']}</div>
            <div class="ui-step-title">{$v1['title']}</div>
            <div class="ui-step-meta">{if !empty($v1['time'])}{php echo date('Y-m-d',$v1['time'])}<br/>{php echo date('H:i:s',$v1['time'])}{/if}</div>
            </li>
            {/loop}
        </ul>
    </div>
    {/if}
    <form class="form-horizontal form" action="" method="post">
        <input type="hidden" name="id" value="{$item['id']}" />
        <input type="hidden" name="dispatchid" value="{$dispatch['id']}" />

        <div  class='row order-container'>
            <div class="order-container-left" style="border-right: 1px solid #efefef;">
                <div class='panel-body' >
                    <h4 class="m-t-none m-b">维权信息</h4>
                    <div class="form-group" style='padding:0 10px;'>
                        <table class='ordertable' style='table-layout:fixed'>
                            <tr>
                                <td style='width:80px'>维权类型：</td>
                                <td>{$r_type[$refund['rtype']]}</td>
                            </tr>

                            {if $refund['rtype']!=2}
                            <tr>
                                <td style='width:80px'>退款金额：</td>
                                <td>{$refund['applyprice']}(元)</td>
                            </tr>
                            {/if}

                            <tr>
                                <td style='width:80px'>维权原因：</td>
                                <td>{$refund['reason']}</td>
                            </tr>

                            <tr>
                                <td style='width:80px'>维权说明：</td>
                                <td>{$refund['content']}</td>
                            </tr>

                            {if !empty($refund['images'])}
                            <tr>
                                <td style='width:80px'>图片凭证：</td>
                                <td>
                                    {loop $refund['images'] $k1 $v1}
                                    <a target='_blank' href='{php echo tomedia($v1)}'><img style='width:100px;;padding:1px;border:1px solid #ccc' src='{php echo tomedia($v1)}' onerror="this.src='../addons/ewei_shopv2/static/images/nopic.png'"></a>
                                    {php break;}
                                    {/loop}
                                    &nbsp;
                                    {if count($refund['images']) > 1}
                                    <a data-toggle='popover' data-html='true' data-placement='right'
                                       data-content="<table style='width:100%;'>
                            {loop $refund['images'] $k1 $v1}
                            <tr>
                            <td  style='border:none;text-align:right;padding:5px;'>
                                <a target='_blank' href='{php echo tomedia($v1)}'><img style='width:100px;;padding:1px;border:1px solid #ccc' src='{php echo tomedia($v1)}'></a>
                            </td>
                            </tr>
                            {/loop}
                    </table>
    ">查看全部</a>
                                    {/if}
                                </td>
                            </tr>
                            {/if}

                            <tr>
                                <td style='width:80px'>维权编号：</td>
                                <td>{$refund['refundno']}</td>
                            </tr>

                            <tr>
                                <td style='width:80px'>订单编号：</td>
                                <td><a href="{:url('groups/order/detail', array('orderid' => $refund['orderid']))}" target="_blank" title="">{$refund['orderno']}</a></td>
                            </tr>

                            <tr>
                                <td>订单金额：</td>
                                <td>￥{php echo number_format($refund['price'],2)} </td>
                            </tr>

                            <tr>
                                <td>买家：</td>
                                <td>{$member['nickname']} <a data-toggle='popover' data-html='true' data-trigger="hover" data-placement='right'
                                                             data-content="<table style='width:100%;'>
                    <tr>
                        <td  style='border:none;text-align:right;' colspan='2'><img src='{$member['avatar']}' onerror='this.src='../addons/ewei_shopv2/static/images/noface.png'' style='width:100px;height:100px;padding:1px;border:1px solid #ccc' /></td>
                    </tr>
                                    <tr>
                        <td  style='border:none;text-align:right;'>昵称：</td>
                        <td  style='border:none;text-align:right;'>{$member['nickname']}</td>
                    </tr>
                    {if $member['realname']}
                    <tr>
                        <td  style='border:none;text-align:right;'>姓名：</td>
                        <td  style='border:none;text-align:right;'>{$member['realname']}</td>
                    </tr>
                    {/if}
                    <tr>
                        <td  style='border:none;text-align:right;'>ID：</td>
                        <td  style='border:none;text-align:right;'>{$member['id']}</td>
                    </tr>
                    {if $member['mobile']}
                    <tr>
                        <td  style='border:none;text-align:right;'>手机号：</td>
                        <td  style='border:none;text-align:right;'>{$member['mobile']}</td>
                    </tr>
                    {/if}
                    {if $member['weixin']}
                    <tr>
                        <td  style='border:none;text-align:right;'>微信号：</td>
                        <td  style='border:none;text-align:right;'>{$member['weixin']}</td>
                    </tr>
                    {/if}
                    </table>
    "><i class='fa fa-question-circle'></i></a></td>
                            </tr>

                            <tr>
                                <td style='width:80px'>付款时间：</td>
                                <td>{php echo date('Y-m-d H:i:s', $refund['paytime'])}</td>
                            </tr>

                            <tr>
                                <td style='width:80px'>付款方式：</td>
                                <td>
                                    {if $refund['pay_type']=='wechat'}
                                    <span class='label label-danger'>微信支付</span>
                                    {elseif $refund['pay_type']=='credit'}
                                    <span class='label label-danger'>余额支付</span>
                                    {elseif $refund['pay_type']=='alipay'}
                                    <span class='label label-danger'>支付宝支付</span>
                                    {elseif $refund['pay_type']}
                                    <span class='label label-default'>{$refund['pay_type']}</span>
                                    {elseif $refund['pay_type']==''}
                                    <span class='label label-default'>未付款</span>
                                    {/if}
                                </td>
                            </tr>

                        </table>

                    </div>
                </div>
            </div>

            <div class="order-container-static" >
                <div class='panel-body' style='height:380px;' >
                    <div class='status'>
                        <span>维权状态: </span>
                            <span class="form-control-static">
                                {if $refund['refundstatus'] == -2}<span class="text-default font20">客户取消{$r_type[$refund['rtype']]}</span>
                                {else if $refund['refundstatus'] == -1}<span class="text-default font20">已拒绝{$r_type[$refund['rtype']]}</span>
                                {else if $refund['refundstatus'] == 0}<span class="text-warning font20">等待商家处理申请</span>
                                {else if $refund['refundstatus'] == 1}<span class="text-default font20">{$r_type[$refund['rtype']]}完成</span>
                                {else if $refund['refundstatus'] == 3}<span class="text-warning font20">等待客户退回物品</span>
                                {else if $refund['refundstatus'] == 4}<span class="text-warning font20">客户退回物品，等待商家重新发货</span>
                                {else if $refund['refundstatus'] == 5}<span class="text-warning font20">等待客户收货</span>{/if}
                            </span>
                    </div>


                    <div class="">
                            <p class="form-control-static ops">
                                {if ($refund['refundstatus'] == 0 || $refund['refundstatus'] > 1)}
                                <a class="btn btn-primary btn-xs" data-toggle="ajaxModal"  href="{:url('groups/refund/submit', array('id' => $item['id'],'refundid' => $refund['id']))}">处理申请</a>
                                {/if}
                            </p>
                    </div>

                    {if $refund['rtype']>0 && !empty($refund['expresssn'])}
                    <div class=''>
                        <div>
                            客户退回物品 :
                        </div>
                        <div class="">
                            <ul class="form-control-static">
                                <li> 快递公司:<span class="text-default"> {if empty($refund['expresscom'])}其他快递{else}{$refund['expresscom']}{/if}</span></li>
                                <li> 快递单号: <span class="text-default">{$refund['expresssn']} &nbsp;&nbsp;&nbsp;<a class='op text-primary' data-toggle="ajaxModal" href="{:url('util/express', array('id' => $item['id'],'express'=>$refund['express'],'expresssn'=>$refund['expresssn']))}">查看物流</a></span></li>
                                <li>  退回时间: <span class="text-default">{php echo date('Y-m-d H:i:s', $refund['sendtime'])}</span></li>
                            </ul>
                        </div>
                    </div>
                    {/if}

                    {if $refund['rtype']==2 && !empty($refund['rexpresssn'])}
                    <div class=''>
                        <div>
                            商家寄出物品 :
                        </div>
                        <div class="">
                            <div class="form-control-static">
                                <li> 快递公司:<span class="text-default"> {if empty($refund['rexpresscom'])}其他快递{else}{$refund['rexpresscom']}{/if}</span></li>
                                <li>快递单号:<span class="text-default"> {$refund['rexpresssn']} &nbsp;&nbsp;&nbsp;<a class='op text-primary' data-toggle="ajaxModal" href="{:url('util/express', array('id' => $item['id'],'express'=>$refund['rexpress'],'expresssn'=>$refund['rexpresssn']))}">查看物流</a></span></li>
                                <li>发货时间:<span class="text-default"> {php echo date('Y-m-d H:i:s', $refund['returntime'])}</span></li>
                            </div>
                        </div>
                    </div>
                    {/if}


                    <!--<div class='order-tips'>-->
                    <!--<div class='row order-tips-title'>友情提醒</div>-->
                    <!--<div class='row order-tips-row'>订单为货到付款，请您务必联系买家确认后再进行发货</div>-->
                    <!--</div>-->

                </div>

            </div>

        </div>

        <br>
        <div class="panel panel-default">
            <div class="panel-heading">
                <span>商品信息</span>
            </div>
            <div class="panel-body table-responsive">
                <table class="table table-hover">
                    <thead class="navbar-inner">
                    <tr>
                        <th style="width:200px">标题</th>
                        <th>商品图片</th>
                        <th style="text-align: center;">单价(元)</th>
                        <th  style="text-align: center;">数量</th>
                        <th style="text-align: center;">金额(元)</th>
                        {if !empty($refund['diyformdata'])}
                        <th style="width:80px;"></th>
                        {/if}
                        <!--<th style="width:5%;">操作</th>-->
                    </tr>
                    </thead>
                    <tr class="trorder">
                        <td class='full'>
                            {$refund['title']}
                        </td>
                        <td>
                            <img src="{php echo tomedia($refund['thumb'])}" style='width:50px;height:50px;border:1px solid #ccc; padding:1px;' onerror="this.src='../addons/ewei_shopv2/static/images/nopic.png'">
                        </td>
                        <td  style="text-align: center;">
                            ¥ {$refund['groupsprice']}
                            <br/>
                        </td>
                        <td  style="text-align: center;">1</td>
                        <td style='text-align: center;'>
                            ¥ {php echo number_format($refund['price'] + $refund['freight'],2)}<br />
                            (含运费:¥ {php echo number_format($refund['freight'],2)})
                        </td>
                        {if !empty($refund['diyformdata'])}
                        <td>
                            <a href='javascript:;' class=btn-xs' hide="1"  data="{$refund['goodid']}" onclick="showDiyInfo(this)">自定义信息</a>
                        </td>
                        {/if}
                        <!--td>
                            <a href="{:url('goods/edit', array('id' => $goods['id']))}" class="btn btn-default btn-sm" title="编辑"><i class="fa fa-edit"></i></a>&nbsp;&nbsp;
                        </td-->
                    </tr>
                    {if !empty($refund['diyformdata'])}
                    <tr>
                        <td colspan='5'>
                            <table class='ordertable' style='table-layout:fixed;display: none;' id="diyinfo_{$refund['goodid']}">
                                {php $datas = $refund['diyformdata']}
                                {loop $refund['diyformfields'] $key $value}
                                <tr>
                                    <td style='width:80px'>{php echo $value['tp_name']}：</td>
                                    <td>
                                        {template 'diyform/diyform'}
                                    </td>
                                </tr>
                                {/loop}
                            </table>
                        </td>
                    </tr>
                    {/if}
                    <tfoot style="border: none;">
                        <tr>
                            <td colspan="5">
                                <div class="price">
                                    <p> <span class="price-inner">  订单金额：</span><span style="font-weight: bold"> ¥ {php echo number_format($order['price']+$order['freight'],2)}</span></p>
                                    <p><span class="price-inner">商品小计：</span><span  style="font-weight: bold">￥{php echo number_format( $refund['price'] ,2)}</span></p>
                                    <p><span class="price-inner">运费：</span><span>￥{php echo number_format( $refund['olddispatchprice'],2)}</span></p>
                                    {if $order['discount']>0}
                                    <p><span class="price-inner">团长优惠：</span><span class="text-danger">- ¥{$order['discount']}</span></p>
                                    {/if}
                                    {if $refund['discountprice']>0}
                                    <p><span class="price-inner">会员折扣：</span><span class="text-danger">-￥{php echo number_format( $refund['discountprice'],2)}</span></p>
                                    {/if}
                                    {if $refund['deductprice']>0}
                                    <p><span class="price-inner">积分抵扣：</span><span class="text-danger">-￥{php echo number_format( $refund['deductprice'],2)}</span></p>
                                    {/if}
                                    {if $refund['deductcredit2']>0}
                                    <p><span class="price-inner">余额抵扣：</span ><span class="text-danger">-￥{php echo number_format( $refund['deductcredit2'],2)}</span></p>
                                    {/if}
                                    {if $refund['deductenough']>0}
                                    <p><span class="price-inner">满额立减：</span><span class="text-danger">-￥{php echo number_format( $refund['deductenough'],2)}</span></p>
                                    {/if}
                                    {if $refund['couponprice']>0}
                                    <p><span class="price-inner">优惠券优惠：</span><span class="text-danger">-￥{php echo number_format( $refund['couponprice'],2)}</span></p>
                                    {/if}
                                    {if intval($refund['changeprice'])!=0}
                                    <p><span class="price-inner">卖家改价：</span><span style='{if 0<$refund['changeprice']}color:green{else}color:red{/if}'>{if 0<$refund['changeprice']}+{else}-{/if}￥{php echo number_format(abs($refund['changeprice']),2)}</span></span></p>
                                    {/if}
                                    {if intval($order['changedispatchprice'])!=0}
                                    <p><span class="price-inner">卖家改运费：</span><span style='{if 0<$refund['changedispatchprice']}color:green{else}color:red{/if}'>{if 0<$refund['changedispatchprice']}+{else}-{/if}￥{php echo abs($refund['changedispatchprice'])}</span></p>
                                    {/if}
                                    <p><span class="price-inner">实付款：</span><span style="font-size: 14px;font-weight: bold;color: #e4393c">￥{php echo number_format($refund['price']-$refund['creditmoney']+$refund['freight'],2)}</span></p>
                                </div>
                            </td>
                        </tr>
                    </tfoot>
                </table>
            </div>
        </div>
    </form>
</div>
{template '_footer'}

<!--4000097827-->